GXX=nvcc
CXXFLAGS=-O2
OTHERS=

SRC= $(wildcard *.cu)
OBJ= $(SRC:.cu=.o)

LIBFLAGS=-lcudart

EXEC=$(shell basename "`pwd`")

all : ${EXEC}

${EXEC}: ${OBJ}
	@echo "Linking ............. : ${EXEC}"
	@${GXX} -o ${EXEC} $^ ${LIBFLAGS} ${CXXFLAGS} ${OTHERS}

%.o : %.cu
	@echo "Compiling ........... : $@"
	@${GXX} -c $< ${CXXFLAGS} ${OTHERS}

.PHONY: clean cleandoc raz doc

clean : 
	@echo "Deleting all *.o"
	@rm -rf *.o

raz : clean
	@echo "Deleting '${EXEC}' runnable" 
	@rm -rf ${EXEC}